//登录注册切换
more_one = document.querySelector("#more-1")
console.log(more_one);
more_two = document.querySelector("#more-2")
console.log(more_two);
tabs = document.querySelector(".tabs")
console.log(tabs);
one_div = document.querySelector("#more-1-div")
console.log(one_div);
two_div = document.querySelector("#more-2-div")
console.log(two_div);
more_one.addEventListener("click", function () {
    more_one.classList.add("tabs_active")
    more_two.classList.remove("tabs_active")
    one_div.style.display = "block"
    two_div.style.display = "none"
})
more_two.addEventListener("click", function () {
    more_one.classList.remove("tabs_active")
    more_two.classList.add("tabs_active")
    one_div.style.display = "none"
    two_div.style.display = "block"
})

//表单  二维码图标切换

staic_erwei = document.querySelector(".staic_erwei")
staic_denglu = document.querySelector(".staic_denglu")
erwei_op = document.querySelector(".erwei-op")
mima_op = document.querySelector(".mima-op")
erwei_box = document.querySelector("#erwei_box")
menu_list = document.querySelector(".menu-list")

staic_erwei.addEventListener("click", function () {
    staic_erwei.style.display = "none"
    erwei_op.style.display = "none"
    mima_op.style.display = "block"
    erwei_box.style.display = "block"
    one_div.style.display = "none"
    two_div.style.display = "none"
    menu_list.style.display = "none"

})

mima_op.addEventListener("click", function () {

    staic_denglu.style.display = "none"
    erwei_op.style.display = "block"
    mima_op.style.display = "none"
    erwei_box.style.display = "none"
    one_div.style.display = "block"
    menu_list.style.display = "block"
    more_one.classList.add("more-active")
})

erwei_op.addEventListener("'click", function () {
    staic_erwei.style.display = "none"
    mima_op.style.display = "block"
    erwei_op.style.display = "none"
    erwei_box.style.display = "block"
    one_div.style.display = "none"
    two_div.style.display = "none"
    menu_list.style.display = "none"
})

//扫码登录鼠标移动、移开
/* erwei_op_text = document.querySelector(".erwei-op-text")
mima_op_text = document.querySelector(".mima-op-text")
staic_erwei.addEventListener("mouseover", function () {
    staic_erwei.style.display = "none"
    erwei_op.style.display = "block"
    erwei_op_text.style.display = "block"
})
erwei_op.addEventListener("mouseleve", function () {
    staic_erwei.style.display = "block"
    erwei_op.style.display = "none"
    erwei_op_text.style.display = "none"
}) */
/* //密码登录鼠标移动、移开
staic_denglu.addEventListener("mouseover", function () {
    staic_denglu.style.display = "none"
    mima_op.style.display = "block"
    mima_op_text.style.display = "block"
})
mima_op.addEventListener("mouseleave", function () {
    staic_denglu.style.display = "block"
    mima_op.style.display = "none"
    mima_op_text.style.display = "none"
}) */



//二维码问号解答
wenhao = document.querySelector("#wenhao")
scan_help = document.querySelector(".scan_help")
wenhao.addEventListener("mouseover", function () {
    wenhao.style.color = "#ff6900"
    scan_help.style.display = "block"
})
wenhao.addEventListener("mouseleave", function () {
    wenhao.style.color = "#bfbfbf"
    scan_help.style.display = "none"
})
//语言选择
lang = document.querySelector(".head-lang")
console.log(lang);
cows = document.querySelector(".cows")
console.log(cows);
lang.addEventListener("mouseover", function () {
    cows.style.display = "block"
})
// mouseout 被添加到单个列表项目上，而 mouseleave 则应用于整个列表
cows.addEventListener("mouseleave", function () {
    cows.style.display = "none"
})

// 注册   输入账号
function input_set(type, elid) {
    lab = document.querySelector("#" + elid.substring(0, elid.indexOf("_")) + "_lab")
    console.log(lab)
    content = lab.parentElement
    console.log(content)
    number = document.querySelector("#number")
    inputel_val = document.querySelector("#" + elid).value
    console.log(inputel_val)
    if (type == 'i') {
        lab.classList.remove("regist_default_sty_lab")
        lab.classList.add('regised_label')
        content.classList.add("wrap1-active")
        number.style.display = "block"
    }
    if (type == 'o' && inputel_val == "") {
        lab.classList.add("regist_lab_active")
        lab.classList.remove('regised_label')
        content.classList.remove("wrap1-active")
        content.classList.add("wrap1-blur")
    }
}
wrap1_login = document.querySelector(".wrap1-login")
log_num = document.querySelector("#log_num")
wrap1_login.addEventListener("click", function () {
    log_num.style.display = "block"
})
//注册  输入登录密码
imgel = document.querySelector(".eye")
console.log(imgel);
pwdel = document.querySelector("#pwd_input")
console.log(pwdel);
flag = 0
imgel.addEventListener("click", function () {
    if (flag === 0) {
        pwdel.type = "password"
        imgel.src = "./img/biyan.png"

        flag = 1
    } else {
        pwdel.type = "text"
        imgel.src = "./img/open.png"
        flag = 0
    }
})

//    登录  国家地区大框（内部点击切换）
content_one = document.querySelector("#content-one")
warning = document.querySelector(".warning")
field_select = document.querySelector(".field-select")
country_about = document.querySelector(".select-country-about")
search_field = document.querySelectorAll(".search-field")[0]
flag = 0
content_one.addEventListener("click", function () {
    if (flag === 0) {
        content_one.classList.remove("login-content")
        content_one.classList.add("login-content-selected")
        search_field.classList.add("search-field")
        search_field.classList.remove("search-field-active")  //下拉框颜色消失
        country_about.style.color = "#aaa"
        warning.style.display = "block"
        field_select.style.display = "block"
        flag = 1
    } else {
        content_one.classList.remove("login-content")
        content_one.classList.add("login-content-selected")
        country_about.style.color = "#333333"
        warning.style.display = "none"
        field_select.style.display = "none"
        flag = 0
    }
})
//   国家地区（大框/下拉列表）
// let t = document.querySelectorAll(".login-content")[0]
document.addEventListener('click', function (e) {    //离开大框消失
    if (!content_one.contains(e.target) && !field_select.contains(e.target)) {
        content_one.classList.remove("login-content-selected")
        content_one.classList.add("login-content")
        country_about.style.color = "#333333"
        warning.style.display = "none"
        field_select.style.display = "none"
    }
    if (more_two.contains(e.target)) {         //登录点击大框颜色正常
        content_one.classList.remove("login-content-selected")
        content_one.classList.add("login-content")
    }
})
search_field.addEventListener("click", function () {  //下拉框点击发生颜色变化，大框颜色消失
    search_field.classList.remove("search-field")
    search_field.classList.add("search-field-active")
    content_one.classList.remove("login-content-selected")
})

//国家码  禁止区域
country_num = document.querySelector(".select-country-num")
console.log(country_num);
content_two = document.querySelector("#content-two")
console.log(content_two);
phe_input = document.querySelector("#phone-input")
console.log(phe_input);
phenumber = document.querySelector(".login-phenumber")
console.log(phenumber);
phe_help = document.querySelector("#phe_help")
console.log(phe_help)
function phe_set(type, elid) {
    if (type == 'm') {
        country_num.classList.remove("select-country-num")
        country_num.classList.add("select-country-num-active")
        content_one.classList.remove("login-content-selected")
        content_two.classList.remove("login-content")
        content_two.classList.add("login-content-active")
        content_two.classList.remove("login-content-blur")
        phenumber.classList.remove("login-phenumber")
        phenumber.classList.add("login-phenumber-active")
        phenumber.classList.remove("login-phenumber-blur")
        phe_help.style.display = "block"
    }
    if (type == 'n') {
        country_num.classList.remove("select-country-num-active")
        country_num.classList.add("select-country-num")
        content_two.classList.remove("login-content-active")
        content_two.classList.add("login-content-blur")
        content_two.classList.remove("login-content-blur")
        content_two.classList.add("login-content-active")
        phenumber.classList.remove("login-phenumber-active")
        phenumber.classList.add("login-phenumber-blur")
    }
}


//获取验证码
inputs = document.querySelector("#checknum-input")
check_login = document.querySelector(".check-login")
content_last = document.querySelector("#content-last")
console.log(content_last);
check_help = document.querySelector("#check_help")
function check_set(type, elid) {
    if (type == 'a') {
        content_last.classList.remove("login-content")
        content_last.classList.add("login-content-active")
        content_last.classList.remove("login-content-blur")
        check_login.classList.remove("check-login")
        check_login.classList.add("check-login-active")
        check_login.classList.remove("check-login-blur")
        check_help.style.display = "block"
    }
    if (type == 'b') {
        content_last.classList.remove("login-content-active")
        content_last.classList.add("login-content-blur")
        content_last.classList.remove("login-content-blur")
        content_last.classList.add("login-content-active")
        check_login.classList.remove("check-login-active")
        check_login.classList.add("check-login-blur")
    }
}



